import random
"""
流程控制
"""
#分支结构-单分支:if
# num_01 = 5
# num_02 = 7
# num_03 = 0
# if num_02 > num_01:
#     num_03 = num_02 - num_01
#     print(num_03)

#分支结构-双分支：if-else
# num_01 = 5
# num_02 = 5
# num_03 = 0
# if num_02 > num_01:
#     num_03 = num_02 - num_01
#     print(num_03)
# else:
#     num_03 = num_02 + num_01
#     print(num_03)

#分支结构-多分支： if - elif - elif ... - else
# num_01 = 5
# num_02 = 3
# num_03 = 0
# if num_02 > num_01:
#     num_03 = num_02 - num_01
#     print(num_03)
# elif num_02 == num_01:
#     num_03 = num_02 * num_01
#     print(num_03)
# else:
#     num_03 = num_02 + num_01
#     print(num_03)

"""
循环结构
"""
#while循环，要求：输入一个整数n，求S = 1 + 2 + 3 +...+ n的值
# n = int(input("请输入一个整数：")) #n
# S = 0
# temp = 0
# while temp <= n:
#     S = S + temp
#     # num = int(input())
#     # if num == -1:
#         # break
#         # continue
#     temp += 1
# print(S)

#for循环，要求：输入一个整数n，求S = 1 + 2 + 3 +...+ n的值
# n = int(input("请输入一个整数："))
# S = 0
# for temp in range(0,n+1):
#     S = S + temp
# print(S)

#continue和break
# for i in range(1,101):
#     if i == 50:
#         # break
#         continue
#     print(i)
# for i in range(1,10):
#     for j in range(1,i+1):
#         print(j," * ",i," = ",i*j,'   ',end='   ')
#     print("\n")

# num = random.randint(0,10)
# print(num)